<!doctype html>
<html lang="en">

<%@ include file="Include_Student_Imports.jsp"%>
<script>
function checkForm()
{
	var password = document.getElementById("password");
	var cpassword1= document.getElementById("cpassword1");
	var cpassword2 = document.getElementById("cpassword2");
	var intExp = /^\d+$/;	
	var floatExp = /^[-+]?[0-9]+(\.[0-9]+)?$/;

	if(cpassword1.value!=cpassword2.value){
		alert('Your new password doesn\'t match');
		return false;
	}

	if (password.value == '' || password.value.indexOf('\\') !== -1 || password.value.indexOf('\'') !== -1 || password.value.indexOf('\"') !== -1)
	{
		alert('Please enter a valid Password.');
		return false;
	} 
	if (cpassword1.value == '' || cpassword1.value.indexOf('\\') !== -1 || cpassword1.value.indexOf('\'') !== -1 || cpassword1.value.indexOf('\"') !== -1)
	{
		alert('Please enter a valid New Password.');
		return false;
	} 
	if (cpassword2.value == '' || cpassword2.value.indexOf('\\') !== -1 || cpassword2.value.indexOf('\'') !== -1 || cpassword2.value.indexOf('\"') !== -1)
	{
		alert('Please enter a valid New Password.');
		return false;
	} 
	return true;
}

</script>
<body>
<!-- HEADER -->
<div style="position: fixed; width: 100%; z-index: 1;">
<%@ include file="Include_Student_Header.jsp"%>

<section id="secondary_bar">
<div class="user"><!-- <a class="logout_user" href="#" title="Logout">Logout</a> -->
</div>
<div class="breadcrumbs_container"><article class="breadcrumbs"><a
	href="StudentHomeServlet">Home</a>
<div class="breadcrumb_divider"></div>
<a class="current">My Profile</a></article></div>
</section>
<!-- end of secondary bar -->
</div>
<%@ include file="Include_Student_Menu.jsp"%>

<section id="main" class="column">

<%@ include file="Include_Student_Message.jsp"%>

<form action="UserChangePasswordServlet" method="post">
<article class="module width_full">
<header>
<h3>Change Password</h3>
</header>
<div class="module_content">
<fieldset style="width: 48%; float: left; margin-right: 3%;">
<label>Current Password</label> <input style="width: 92%;"
	type="password" name="oldPassword" id="password"></fieldset>
<div class="clear"></div>
<fieldset style="width: 48%; float: left;"><label>New
Password</label> <input style="width: 92%;" type="password" name="newPassword1" id="cpassword1"></fieldset>
<div class="clear"></div>
<fieldset style="width: 48%; float: left;"><label>Repeat
Password</label> <input style="width: 92%;" type="password" name="newPassword2" id="cpassword2"></fieldset>
<div class="clear"></div>
<div class="spacer"></div>

</div>

<footer>
<div class="submit_link"><input type="submit" value="Update" class="alt_btn" onclick="return checkForm()"></div>
</footer>

</article>
</form>
<!-- end of post new article -->


<div class="spacer"></div>
</section>


</body>

</html>